#include<stdio.h>
#include <unistd.h>
#include <sys/types.h> 
#include <sys/stat.h>
#include <fcntl.h>



int main()
{
     int fd=open("ct.txt",O_CREAT | O_WRONLY,0666);
     dup2(fd,1);
     write(1,"hello ",sizeof("hello"));
     char a[]="world\n";
     write(fd,(void*)a,sizeof(a));
     close(1);
     printf(" 你的名字:%d\n",fd);
     fflush(stdout);
     close(fd);
     return 0;
}
